package P2PChat;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class Agent {
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(10002);
        Socket socket = serverSocket.accept();
        System.out.println("连上了");
        DataInputStream din = new DataInputStream(socket.getInputStream());//使用了数据流接收数据
        String content = din.readUTF();
        System.out.println(content);
        din.close();
        socket.close();
    }
}
